/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.click.app.model;

import java.io.Serializable;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import javax.persistence.*;
/**
 *
 * @author arnold
 */

@Entity
@Table(name="transactions")
public class Transaction extends BaseObject implements Serializable {

    private static final long serialVersionUID = 3832626162173359411L;
    private Long id;
    private String codeTransaction;
    private String textPrinted;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    @Column(name="id_transaction")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name="code_transaction")
    public String getCodeTransaction() {
        return codeTransaction;
    }

    public void setCodeTransaction(String codeTransaction) {
        this.codeTransaction = codeTransaction;
    }


    @Column(name="text_printed", length=20000)
    public String getTextPrinted() {
        return textPrinted;
    }

    public void setTextPrinted(String textPrinted) {
        this.textPrinted = textPrinted;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Transaction other = (Transaction) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        if ((this.codeTransaction == null) ? (other.codeTransaction != null) : !this.codeTransaction.equals(other.codeTransaction)) {
            return false;
        }
        if ((this.textPrinted == null) ? (other.textPrinted != null) : !this.textPrinted.equals(other.textPrinted)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 41 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 41 * hash + (this.codeTransaction != null ? this.codeTransaction.hashCode() : 0);
        hash = 41 * hash + (this.textPrinted != null ? this.textPrinted.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", this.id)
                .append("codeTransaction", this.codeTransaction)
                .append("textPrinted", this.textPrinted)
                .toString();
    }

}
